using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
namespace MRSite.Entity
{
    /// <summary>
    /// 升级记录表
    /// </summary>
    [Table(Name = "upgrade_log")]
    public class UpgradeLog : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

        /// <summary>
        ///
        /// </summary>
        [Column(Name = "user_id")]
        public int user_id { get; set; }

        /// <summary>
        /// 原等级
        /// </summary>
        [Column(Name = "oldlevelid")]
        public int oldlevelid { get; set; }


        /// <summary>
        /// 原等级
        /// </summary>
        [Column(Name = "oldlevelname")]
        public String oldlevelname { get; set; }

        /// <summary>
        /// 新等级
        /// </summary>
        [Column(Name = "newlevelid")]
        public int newlevelid { get; set; }

        /// <summary>
        /// 新等级
        /// </summary>
        [Column(Name = "newlevelname")]
        public String newlevelname { get; set; }

        /// <summary>
        /// 消耗金额
        /// </summary>
        [Column(Name = "amount")]
        public Decimal amount { get; set; }



        /// <summary>
        ///
        /// </summary>
        [Column(Name = "addtime", IsDbGenerated = true)]
        public DateTime addtime { get; set; }

        /// <summary>
        ///0待处理,1成功,2失败
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }


        /// <summary>
        ///处理时间
        /// </summary>
        [Column(Name = "checktime")]
        public DateTime? checktime { get; set; }

        /// <summary>
        /// 审核内容
        /// </summary>
        [Column(Name = "contents")]
        public String contents { get; set; }

        /// <summary>
        /// 升级类别 1用户积分兑换升级；2：用户根据条件自动升级；3：后台操作
        /// </summary>
        [Column(Name = "sjtype")]
        public int sjtype { get; set; }



        /// <summary>
        /// 备注
        /// </summary>
        [Column(Name = "remark")]
        public String remark { get; set; }

        private EntityRef<Customer> _member;

        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "user_id", OtherKey = "id")]
        public Customer CustomerItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }
    }
}

